home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / create games (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  848b  |  38 lines

  1. 0 rem--ahoy!--june issue--create games--prog page 13
  2. 5 dim hm(7),vm(64)
  3. 10 gosub 600:gosub 500
  4. 80 v=10:h=10
  5. 90 goto 140
  6. 97 rem
  7. 98 rem main movement loop
  8. 99 rem
  9. 100 v=vx+vm(peek(197)):h=hx+hm(peek(653))
  10. 110 if h=hx and v=vx then 100
  11. 120 if v>be then v=v-bf
  12. 121 if v<0 then v=v+bf
  13. 122 if h>re then h=h-rf
  14. 123 if h<0 then h=h+rf
  15. 140 print vm$(vx)tab(hx)" "vm$(v)150 hx=h:vx=v
  16. 190 goto 100
  17. 497 rem
  18. 498 rem set up movement strings
  19. 499 rem
  20. 500 dim vm$(be):vm$(0)=chr$(19)
  21. 510 for i=1 to be:vm$(i)=vm$(i-1)+chr$(17):next
  22. 540 return
  23. 597 rem
  24. 598 rem setup for commodore 64
  25. 599 rem
  26. 600 re=38:rem vic value is 20
  27. 605 rf=39:rem vic value is 21
  28. 610 be=23:rem vic value is 21
  29. 615 bf=24:rem vic value is 22
  30. 620 pf$=chr$(122)
  31. 630 poke 53281,0:poke 53280,0
  32. 631 rem vic line: 630 poke 36879,8
  33. 640 poke 657,128:print chr$(147)
  34. 650 for i=0 to 64:vm(i)=0:next:for i=0 to 7:hm(i)=0:next
  35. 660 hm(1)=1:hm(2)=-1:vm(3)=1:vm(6)=-1
  36. 661 rem vic line: 660 hm(1)=1:hm(2)=-1:vm(63)=1:vm(55)=-1
  37. 690 return
  38.